
clear all
macro drop _all
set more off

global path "<CHANGE THIS PATH>" // change to the path where the replication folder sits

*------------------------------------------------------------------------------------

ssc install outreg2, replace
net install grc1leg, from (http://www.stata.com/users/vwiggins)
net install grc1leg2, from (http://digital.cgdev.org/doc/stata/MO/Misc/)

update all
ado update, update

*------------------------------------------------------------------------------------

** Create working data files from raw census data
do "$path\Code\USCensus_makevars.do"
do "$path\Code\IsraeliCensus_makevars.do"
do "$path\Code\CommunistCensus_makevars.do"

** Primary analysis files, using working data created in the three programs above
do "$path\Code\USCensus_analysis.do"
do "$path\Code\IsraeliCensus_analysis.do"
do "$path\Code\CommunistCensus_analysis.do"

** Make figures
do "$path\Code\fig1.do"
do "$path\Code\figd1.do"

***** STOP HERE
pause on
pause "Compile output files in Compile_Tables.xlsx before proceeding (see README), then type 'end' in the command window to resume code execu"

***** BEFORE PROCEEDING, YOU MUST OPEN THE FILE \Output\Compile_Tables.xlsx AND REFRESH ANY EXTERNAL LINKS

** Make final figures that rely on Compile_Tables.xlsx
do "$path\Code\figs_3_b2_b3.do"
do "$path\Code\figs_b1_b4.do"
do "$path\Code\figs_b5_d2.do"

* In-text stats
do "$path\Code\in_text_stats.do"